package huy.mmt.gamelathinh;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;

public class Logo extends MyApp {

	public static MediaPlayer bg_mussic, ms_click, ms_gameover, ms_bad,
			ms_good, ms_finish, ms_gamewin;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_logo);

		bg_mussic = MediaPlayer.create(this, R.raw.backgroundmusic);

		bg_mussic.start();

		Thread splashtread = new Thread() {
			public void run() {
				try {
					synchronized (this) {
						wait(2000);
					}
				} catch (InterruptedException e) {
				} finally {

					Intent menu = new Intent(Logo.this, Main.class);
					startActivity(menu);
					finish();
					Log.d("Load Main", "Logo.lass finish to Main.class");
				}
			}
		};
		splashtread.start();

		/**
		 * chua cac tham so lien quan am thanh duoc su dung
		 * 
		 */
		ms_click = MediaPlayer.create(this, R.raw.click);

		ms_gameover = MediaPlayer.create(this, R.raw.gameover);

		ms_bad = MediaPlayer.create(this, R.raw.bad);

		ms_good = MediaPlayer.create(this, R.raw.good);

		ms_finish = MediaPlayer.create(this, R.raw.finish);
		
		ms_gamewin = MediaPlayer.create(this, R.raw.game_win);

	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		bg_mussic.stop();
	}

}
